/* -*- Mode: java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * Copyright (c) 2003-2005-2005 Jeffrey Palm.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * This code is part of the jeffpalm.java project
 * hosted at sourceforge.net whose homepage is
 * 
 *   http://javapalm.sourceforge.net
 * 
 * Any questions should be directed to javapalm@jeffpalm.com
 * ----------
 * $Log: CenterHelper.java,v $
 * Revision 1.5  2005/12/04 17:00:52  jeffpalm
 * myscp
 *
 * Revision 1.4  2005/12/04 15:38:51  jeffpalm
 * lots and lots and lots
 *
 * Revision 1.2  2004/02/19 13:11:00  jeffpalm
 * First check-in ini a while.
 *
 * Revision 1.1.1.1  2003/01/31 16:55:53  jeffpalm
 * initial import into CVS
 *
 */

import java.awt.*;
import java.util.*;

public class CenterHelper {

  public final static void center(Component f) {
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    int x = (int) ((d.getWidth() - f.getWidth()) / 2);
    int y = (int) ((d.getHeight() - f.getHeight()) / 2);
    f.setLocation(x, y);
  }
}
